<?php
use yii\helpers\Url;
use app\models\Supplier;
use app\modules\Product\models\Product;
use yii\widgets\LinkPager;
use yii\helpers\ArrayHelper;
use app\components\JSSDK;

$supplier = Supplier::find()->where(['status'=>1])->all();
$supplier = yii\helpers\ArrayHelper::map($supplier,'id','company');

$this->title = "航线列表";

$day_num = [1=>'1-5天',2=>'6-10天',3=>'11-15天',4=>'15天以上'];


$pro_price = [1=>'3000元以下',2=>'3001-5000元',3=>'5001-6000元',4=>'6001-7000元',5=>'7001-8000元',6=>'8001-10000元',7=>'10000元以上'];

//$pro_line = yii::$app->params['line'];

$from_all_supplier = (new \yii\db\Query())
    ->select(['COUNT(c.supplier_id) as f_city','p.id','c.supplier_id'])
    ->from('product as p')
    ->leftJoin('cruise as c','c.id = p.cruise_id')
    ->where(['p.status'=>1])
    ->andFilterWhere(['>=','p.go_time',$today])
    ->addGroupBy('c.supplier_id')
    ->orderBy('f_city desc')
    ->all();

$from_all_city = (new \yii\db\Query())
    ->select(['COUNT(from_city) as f_city','id','from_city'])
    ->from('product')
    ->where(['status'=>1])
    ->andFilterWhere(['>=','go_time',$today])
    ->addGroupBy('from_city')
    ->orderBy('f_city desc')
    ->all();

$all_line = (new \yii\db\Query())
    ->select(['COUNT(line) as f_line','id','line'])
    ->from('product')
    ->where(['status'=>1])
    ->andFilterWhere(['>=','go_time',$today])
    ->addGroupBy('line')
    ->orderBy('f_line desc')
    ->all();

$all_cruise = (new \yii\db\Query())
    ->select(['COUNT(p.cruise_id) as f_city','p.cruise_id','c.name','c.supplier_id'])
    ->from('product as p')
    ->leftJoin('cruise as c','c.id = p.cruise_id')
    ->where(['p.status'=>1])
    ->andFilterWhere(['>=','p.go_time',$today])
    ->addGroupBy('p.cruise_id')
    ->all();    

$pro_line = ArrayHelper::map($all_line,'line',function ($element) {
    return yii::$app->params['line'][$element['line']];
});


$pro_city = ArrayHelper::map($from_all_city,'from_city',function ($element) {
    return yii::$app->params['city'][$element['from_city']];
});

$pro_supplier = ArrayHelper::map($from_all_supplier,'supplier_id',function($element) {
    return $element['supplier_id'];
});

foreach($pro_supplier as $key=>$val){
    $pro_supplier[$key] = $supplier[$val];
}



$pro_cruise = $all_cruise;

//邮轮公司logo
$logo_path = [
        3=>'/img/logo3/3.png',
        4=>'/img/logo3/4.png',
        5=>'/img/logo3/5.png',
        6=>'/img/logo3/6.png',
        7=>'/img/logo3/7.png',
        8=>'/img/logo3/8.png',
        9=>'/img/logo3/9.png',
        10=>'/img/logo3/10.jpg',
]; 

$jssdk = new JSSDK("wxdf104a667847eb11", "1e1b098e7c4f442d94fe3499463238f2");
$signPackage = $jssdk->GetSignPackage();

?>
<script type="text/javascript" src="/js/iconfont.js"></script>
<?= yii\web\View::registerCssFile("/css/front/index.css",['depends' => 'app\assets\MuiAsset']) ?>
<?= yii\web\View::registerCssFile("/css/front/index-n.css",['depends' => 'app\assets\MuiAsset']) ?>


<style type="text/css">
    .mui-bar-nav{background-color: #f7f7f8}
    .mui-tab-item{margin-top: 5px;}
    .city{background-color: #f7f7f7}
    .text-center{text-align: center;}
    .mui-popover {height: 300px;}
    .city{color: #0A95CC;margin-top: 0px;}
    .city p{color: #0A95CC;font-size: 16px;}
    .city .iconfont{color: #0A95CC;font-size: 18px;}
    .mui-card{margin: 0;}
    .mui-bar-tab{background-color:#FFF;}
    .mui-tab-item .tab-label {font-size: 0.7rem;}
    .mui-tab-item{margin-top: 5px;}
    .mui-tab-item .iconfont{margin-top: 8px;}
    .mui-bar-tab .mui-tab-item.mui-active{color: rgb(41, 167, 226);}
    .mui-bar-tab .mui-tab-item.nav-active{color: rgb(41, 167, 226);}
    .mui-checkbox input[type=checkbox]:checked:before, .mui-radio input[type=radio]:checked:before{color: rgb(41, 167, 226);}

    .pic-box{width: 100%;position: absolute;z-index: 2;left: 0;top: 50vw;background: url(/img/bg_opacity40.png);height: 10vw;}
    .pic-box-name{line-height: 10vw;font-size:1rem;color: #FFF;}
    .pic-top{position: absolute;left: 0;top:0;background:url(/img/bg_price.png);background-repeat:no-repeat;background-size: cover;/*padding: 4px;*/text-align: center;color: #FFFFFF;width:26vw;margin-left: 5%;height: 13vw;}

    .line-box{position:absolute;width:30%;height:60px;background:rgba(0,0,0,0.5);margin-left: 4%;margin-top: -20%;}
    .box-bl{border:1px solid; border-color:rgba(255,255,255,0.5);margin: 5px;height: 50px;}
    .box-bl p{color: #FFFFFF;font-size: 14px;text-align: center;height: 25px;line-height: 25px;margin: 0;font-weight: bold;}

    .icon {
       width: 1.4rem; height: 1.4rem;
       vertical-align: -0.3em;
       fill: currentColor;
       overflow: hidden;
    }
    .mui-card-new{background-color:transparent !important;box-shadow: none !important;}  
    .mui-card-new .mui-input-group{background-color:transparent}

    .mui-pagination>li>a, .mui-pagination>li>span{color: #a664a6;}
    .mui-pagination>li.mui-active>a, .mui-pagination>li.mui-active>a:active, .mui-pagination>li.mui-active>span, .mui-pagination>li.mui-active>span:active, .mui-pagination>li:active>a, .mui-pagination>li:active>a:active, .mui-pagination>li:active>span, .mui-pagination>li:active>span:active{border-color: #a664a6;background-color: #a664a6;}

    .line-list{padding:10px;margin:10px 0px;border-radius:0px;background-color: #FFFFFF;}

    .cruise-line{padding-bottom: 48px;}


</style>


<div class="mui-content">
    <div class="cruise-line">
      <?php foreach($lines as $v){?>
      <div class="line-list" data-href="<?=Url::toRoute(['lines','id'=>$v->id])?>">
		  <?php if(isset($v->image)) { ?>
          <img  src="<?=\Yii::$app->params['qiniu_path'].$v->image->path.'?imageView2/1/w/360/h/220'?>" width="40%">
		  <?php }else{ ?>
          <img  src="/img/load.jpg" width="40%">
		  <?php } ?>

          <div class="line-box">
            <div class="box-bl">
              <p><?=$v->go_time?></p>
              <p><?=yii::$app->params['city'][$v->go_city]?>上船</p>
            </div>  
          </div>
               
          <div style="width:55%;float: right;">
              <div class="mui-row">
                  <div class="mui-col-xs-12" style="font-size:0.8rem;color: #333;">
                      <?=$v->name?>
                  </div>
              </div>  
              <p style="font-size: 0.6em;margin: 5px 0;color: #666">
                  <img src="<?=isset($logo_path[$v->cruise->supplier_id])?$logo_path[$v->cruise->supplier_id]:'/img/logo/400.png'?>" style="height:0.8rem;vertical-align: middle;line-height: 0.8rem" >
                  <span style="font-size:0.8rem;height:0.8rem;vertical-align: middle;line-height: 0.8rem"><?=$supplier[$v->cruise->supplier_id]?></span>
              </p>
              <p class="color-b" style="margin:5px 0;">
                  <span style="font-size:1rem;color: #FA6114">¥<?=floor($v->minPrice)?></span>
                  <span style="font-size: 0.6rem;color: #FA6114;">起/人</span>
                  <?php if($v->sale){ ?>
                  <span class="mui-pull-right" style="margin-right: 10px;">
                     <span style="color:#FFFFFF;padding:4px 5px;background-color:#FF0000;">惠</span>
                  </span>
                  <?php }?>
              </p>
          </div>       
      </div>
      <?php }?>
       
      <div class="mui-content-padded text-center">
      <?= yii\widgets\LinkPager::widget(['pagination' => $provider->pagination,'lastPageLabel'=>false, 'firstPageLabel'=>false,'maxButtonCount'=>5,'activePageCssClass'=>'mui-active','disabledPageCssClass'=>'mui-disabled','nextPageLabel' => false,'prevPageLabel' => false,'options'=>['class'=>'mui-pagination']]); ?>
      </div>
    </div>  
</div>

<ul class="bottom_filter dn" id="filter_list_bottom" style="z-index: 100;">
    <li data-type="FilterAllExceptSort" id="sx"
      <?=(isset($params['price']) && $params['price'] > 0 || isset($params['lines']) && $params['lines'] > 0 || isset($params['from_city']) && $params['from_city'] > 0 || isset($params['cruise_id']) && $params['cruise_id'] > 0  || isset($params['supplier_id']) && $params['supplier_id'] > 0 || isset($params['day']) && $params['day'] > 0 || isset($params['month']) && $params['month'] > 0) ? 'class="selected"' : ''?>
    ><i class="icon_city"></i>筛选</li>
    <li data-type="Sorts" id="px" <?=($sort>0)?'class="selected"':''?> ><i class="icon_sort"></i>排序</li>
</ul>

<div class="filter_pop_wrap" style="position: fixed;z-index: 4960;bottom: 0px; left: 0px;display: none;">
    
    <div class="filter_pop_hd">
      <span class="filter_btn_cancel" id="search_layer_hide">取消</span> 
      <span class="filter_btn_ok" id="search_submit">确认</span> 
      <span class="filter_btn_clear" id="search_key_clear">清空筛选</span>
    </div>

    <div class="filter_pop_bd" style="height:300px;">
        <div class="filter_list_box" id="filter_all_except_sort_box">
            <div class="filter_column filter_nav">
              <div class="filter_scroll" style="width: 100%;">
                  <ul class="filter_item" id="search_nav" style="width: 100%; display: inline-block;">
                      <li data-key="Cities"  <?= (isset($params['from_city']) && $params['from_city'] > 0) ? 'class="selected"' : ''?> style="background-color: white;">出发城市</li>
                      <li data-key="Price" <?= (isset($params['price']) && $params['price'] > 0) ? 'class="selected"' : ''?> >价格</li>
                      <li data-key="Month"  <?= (isset($params['month']) && $params['month'] > 0) ? 'class="selected"' : ''?>>月份</li>
                      <li data-key="Company"  <?= (isset($params['cruise_id']) && $params['cruise_id'] > 0) || (isset($params['supplier_id']) && $params['supplier_id'] > 0) ? 'class="selected"' : ''?>>邮轮名称</li>
                      <li data-key="VoyaRegions"  <?= (isset($params['lines']) && $params['lines'] > 0) ? 'class="selected"' : ''?> >邮轮航线</li>
                      <li data-key="DayRanges"  <?= (isset($params['day']) && $params['day'] > 0) ? 'class="selected"' : ''?>>行程天数</li>
                  </ul>
              </div>
            </div>

            <div class="xh_pop_sub1 filter_column filter_sub_nav" style="display: none;" id="search_companies">
              <div class="view cui-layer" style="z-index: 3022; top: initial; left: 0px; width: 100%; margin: 0px; padding: 0px; position: inherit;">
              <div class="cui-pop-box" style="height: 100%; width: 100%; background: none;">
                  <div class="cui-bd" style="overflow: hidden; position: relative; width: 100%; height: 300px; background: none;">
                        <ul class="filter_item" data-rootkey="Companies" id="companies" data-sonkey="ShipIds" style="box-sizing: border-box; width: 100%; background: none; height: 300px; overflow: scroll; ">  
                          <?php foreach($pro_supplier as $key=>$val){ ?>
                            <li data-id="<?=$key?>" data-name="<?=$val?>" <?= (isset($params['supplier_id']) && $params['supplier_id'] == $key) ? 'class="current"' : ''?> ><?=$val?></li>
                          <?php }?>  
                        </ul>
                  </div>
                  <div class="cui-roller-btns"></div>
              </div>
              </div>
            </div>

            <div class="xh_pop_sub2 filter_column" id="reg_date_day">
                <div class="layer1" style="z-index: 3016; top: initial; left: 0px; width: 100%; margin: 0px; padding: 0px; position: inherit;" id="ui-view-25">
                  <div class="cui-pop-box" style="height: 100%; width: 100%; background: none;">                        
                     <div class="cui-bd" style="overflow: hidden;position: relative;width: 100%;height: 300px;background: none;">
                           <ul class="filter_item_list" style="box-sizing: border-box; width: 100%; background: none; overflow: scroll; height: 300px;display: inline-block;" id="Cities">
                               <li data-id="0" <?= (!isset($params['from_city']) || $params['from_city'] == 0) ? 'class="selected"' : ''?>>不限</li>
                                <?php foreach($pro_city as $key=>$val){ ?>  
                                  <li data-id="<?=$key?>" data-name="<?=$val?>" <?= (isset($params['from_city']) && $params['from_city'] == $key) ? 'class="selected"' : ''?> ><?=$val?></li>
                                 <?php }?>
                            </ul>
                            <ul class="filter_item_list" style="box-sizing: border-box; width: 100%; background: none; overflow: scroll; height: 300px;" id="Price">
                                <li data-id="0" data-name="" <?= (!isset($params['price']) || $params['price'] == 0) ? 'class="selected"' : ''?> >不限</li>
                              <?php foreach($pro_price as $key=>$val){?>
                                <li data-id="<?=$key?>" data-name="" <?= (isset($params['price']) && $params['price'] == $key) ? 'class="selected"' : ''?> ><?=$val?></li>
                              <?php }?>  
                            </ul>
                            <ul class="filter_item_list" style="box-sizing: border-box; width: 100%; background: none; overflow: scroll; height: 300px" id="Month">
                                <li data-id="0" data-name="" <?= (!isset($params['month']) || $params['month'] == 0) ? 'class="selected"' : ''?> >不限</li>
                                <?php foreach($month as $key=>$val){ ?>
                                <li data-id="<?=$key?>" data-name="" <?= (isset($params['month']) && $params['month'] == $key) ? 'class="selected"' : ''?> ><?=$val?></li>
                                <?php }?>
                            </ul>
                            <ul class="filter_item_list" style="box-sizing: border-box; width: 100%; background: none; overflow: scroll; height: 300px;" id="Company">
                                <li data-id="0"  <?=(!isset($params['cruise_id']) || $params['cruise_id'] == 0) ? 'class="selected"' : ''?>  style="display: block;">不限</li>
                                <?php foreach($pro_cruise as $key => $val){ ?>
                                <li data-id="<?=$val['cruise_id']?>" data-key="<?=$val['supplier_id']?>" data-name="<?=$val['name']?>" style="display:none;" <?= (isset($params['cruise_id']) && $params['cruise_id'] == $val['cruise_id']) ? 'class="selected"' : ''?> ><?=$val['name']?></li>
                                <?php }?>
                            </ul>
                            <ul class="filter_item_list" style="width: 100%; background: none; overflow: scroll; height: 300px;" id="VoyaRegions">
                                <li data-id="0" data-name="不限" <?= (!isset($params['lines']) || $params['lines'] == 0) ? 'class="selected"' : ''?> >不限</li>
                                <?php foreach($pro_line as $key=>$val){?>
                                <li data-id="<?=$key?>" data-name="<?=$val?>" <?= (isset($params['lines']) && $params['lines'] == $key) ? 'class="selected"' : ''?> ><?=$val?></li>
                                <?php }?>
                            </ul>
                            <ul class="filter_item_list" style="box-sizing: border-box; width: 100%; background: none; overflow: scroll; height: 300px;" id="DayRanges">
                                <li data-id="0" data-name="不限" <?= (!isset($params['day']) || $params['day'] == 0) ? 'class="selected"' : ''?> >不限</li>
                                <?php foreach($day_num as $key=>$val){ ?>
                                <li data-id="<?=$key?>" data-name="<?=$val?>" <?= (isset($params['day']) && $params['day'] == $key) ? 'class="selected"' : ''?> ><?=$val?></li>
                                <?php }?>
                            </ul>
                            </div>
                          <div class="cui-roller-btns"></div>
                      </div>
                  </div>
            </div>
       </div>

    </div>

</div>


<div class="layer" style="z-index: 3002; top: initial; bottom: 0.1px; left: 0px; width: 100%; margin: 0px; padding: 0px; position: fixed;display:none;">
  <div class="cui-pop-box" style="height: 100%; width: 100%;">
      <div class="cui-bd" style="overflow: hidden; position: relative; width: 100%; height: 300px; background-color: rgb(250, 250, 250);">
          <div class="pop_filter pop_filter_sort" id="filter_sorts" style="position: absolute; background-color: white;">
              <div class="pop_filter_tit">当前结果按照以下方式排序</div>
                <ul class="pop_filter_baselist" style="box-sizing: border-box;">
                    <li data-index="3" data-sort="Price" <?=($sort == 3)?'class="choosed"':''?> data-direction="false">价格从低到高</li>
                    <li data-index="4" data-sort="Price" <?=($sort == 4)?'class="choosed"':''?> data-direction="true">价格从高到低</li>
                    <li data-index="5" data-sort="Days" <?=($sort == 5)?'class="choosed"':''?> data-direction="false">天数从少到多</li>
                    <li data-index="6" data-sort="Days" <?=($sort == 6)?'class="choosed"':''?> data-direction="true">天数从多到少</li>
                    <li data-index="7" data-sort="Date" <?=($sort == 7)?'class="choosed"':''?> data-direction="false">日期从近到远</li>
                    <li data-index="8" data-sort="Date" <?=($sort == 8)?'class="choosed"':''?> data-direction="false">日期从远到近</li>
                </ul>
          </div>
      </div>
  </div>
</div>

<div class="mask"  id="mask" style="width: 100%; height:2000px;display: none; position: absolute; left: 0px; top: 0px; z-index: 3001; background: rgba(0, 0, 0, 0.498039);"></div>


<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>

<?php app\components\JsBlock::begin() ?>
<script type="text/javascript">

var url = "<?= yii::$app->request->getHostInfo()?>"+"/front/default/index";    
var order_url = "<?= yii::$app->request->getUrl()?>";
var sign = (url.indexOf('?') == -1) ?  "?" : "&";
var order_sign = (order_url.indexOf('?') == -1) ?  "?" : "&";
var sort = "<?=$sort?>";
var cruise_id = "<?= (isset($params['cruise_id']) && $params['cruise_id']) ? $params['cruise_id'] : 0 ?>";

$("#sx").click(function(){
    $(".filter_pop_wrap").show();
    $(".mask").show();
});
$("#px").click(function(){
    $(".mask").show();
    $(".layer").show();
});
$("#mask").click(function(){
    $(".mask").hide();
    $(".filter_pop_wrap").hide();
    $(".layer").hide();
});

function init(){
  if(cruise_id > 0){
    $("#Company").find("li[data-id='0']").attr("class","");
    $("#Company").find("li[data-id='"+cruise_id+"']").attr("class","selected");
    $("#companies").find("li[data-id='"+$("#Company").find("li[data-id='"+cruise_id+"']").attr("data-key")+"']").attr("class","current");
    $("#Company").find("li[data-key='"+$("#Company").find("li[data-id='"+cruise_id+"']").attr("data-key")+"']").css("display","block");
  }
 
}

init();



//清空筛选
$("#search_key_clear").click(function(){
    $(".filter_item").find("li").each(function(){
        $(this).attr("class","");
    });
    $(".filter_item_list").find("li").each(function(){
        $(this).attr("class","");
    });
    $(".filter_item_list").each(function(){
        $(this).find("li[data-id=0]").attr("class","selected");
    });
    if(sort>0){
      location.href = url+sign+"sort="+sort;
    }else{
      location.href = url;
    }
});

$("#search_layer_hide").click(function(){
      $(".filter_pop_wrap").hide();
      $(".mask").hide();
});


$("#search_nav").find("li").click(function(){
    if ($(this).attr("data-key")=="Company") {
        $("#search_companies").show();
    }else {
        $("#search_companies").hide();
    }
    $("#search_nav").find("li").each(function(){
        $(this).attr("style","");
    });
    $(this).attr("style","background-color: white;");
    $(".filter_item_list").each(function(){
        $(this).css("display","");
    });
    $("#search_nav").css("display","inline-block");
    $("#"+$(this).attr("data-key")).css("display","inline-block");
});

$("#companies").find("li").click(function(){
    $("#companies").find("li").each(function(){
        $(this).attr("class","");
    });
    $(this).attr("class","current");
    var scid = $(this).attr("data-id");
    $("#Company").find("li").css("display","none");
    $("#Company").find("li[data-id='0']").css("display","block");
    $("#Company").find("li").each(function(){
        if ($(this).attr("data-key") ==scid) {
            $(this).css("display","block");
        }
    });
});

$(".pop_filter_baselist").find("li").click(function(){
    var orderid = $(this).attr("data-index");
    location.href= order_url+order_sign+"sort="+orderid;
});


$(".filter_item_list").find("li").click(function(){
    $(this).parent().find("li").each(function(){
        $(this).attr("class","");
    });
    $(this).attr("class","selected");
    if($(this).parent().attr("id")=="Cities") {
        if($(this).attr("data-id")>0){
          $("#search_nav").find('[data-key=Cities]').addClass("selected");
        }else if($(this).attr("data-id") ==0){
          $("#search_nav").find('[data-key=Cities]').removeClass("selected");
        }
    }
    else if ($(this).parent().attr("id")=="Price") {
        if($(this).attr("data-id")>0){
          $("#search_nav").find('[data-key=Price]').addClass("selected");
        }else if($(this).attr("data-id") ==0){
          $("#search_nav").find('[data-key=Price]').removeClass("selected");
        }
    }
    else if ($(this).parent().attr("id")=="Month") {
        if($(this).attr("data-id")>0){
          $("#search_nav").find('[data-key=Month]').addClass("selected");
        }else if($(this).attr("data-id") ==0){
          $("#search_nav").find('[data-key=Month]').removeClass("selected");
        }
    }
    else if ($(this).parent().attr("id")=="Company") {
        if($(this).attr("data-id")>0){
          $("#search_nav").find('[data-key=Company]').addClass("selected");
        }else if($(this).attr("data-id") ==0){
          $("#search_nav").find('[data-key=Company]').removeClass("selected");
        }
    }
    else if ($(this).parent().attr("id")=="VoyaRegions") {
        if($(this).attr("data-id")>0){
          $("#search_nav").find('[data-key=VoyaRegions]').addClass("selected");
        }else if($(this).attr("data-id") ==0){
          $("#search_nav").find('[data-key=VoyaRegions]').removeClass("selected");
        }
    }
    else if ($(this).parent().attr("id")=="DayRanges") {
       if($(this).attr("data-id")>0){
          $("#search_nav").find('[data-key=DayRanges]').addClass("selected");
        }else if($(this).attr("data-id") ==0){
          $("#search_nav").find('[data-key=DayRanges]').removeClass("selected");
        }
    }
});

$("#search_submit").click(function(){
    var href = url+sign;
    $(".filter_item_list").find("li[class='selected']").each(function(){
        var val = $(this).attr("data-id");
        if(val > 0){
          if($(this).parent().attr("id")=="Cities") {
               href += "from_city="+val+"&";
          }else if ($(this).parent().attr("id")=="Price") {
               href += "price="+val+"&";
          }else if ($(this).parent().attr("id")=="Month") {
               href += "month="+val+"&";
          }else if ($(this).parent().attr("id")=="Company") {
               href += "cruise_id="+val+"&";
          }else if ($(this).parent().attr("id")=="VoyaRegions") {
               href += "lines="+val+"&";
          }else if ($(this).parent().attr("id")=="DayRanges") {
               href += "day="+val+"&"; 
          }
        }
    });
    var company = $("#Company").find("li[class='selected']");
    var cruise_id = $(company).attr("data-id"); 
    if(cruise_id == 0){
      var companies = $("#companies").find("li[class='current']");
      var supplier_id = $(companies).attr("data-id");
      if(supplier_id > 0){
        href += "supplier_id="+supplier_id+"&"; 
      } 
    }
   
    if(sort>0){
      location.href = href+"sort="+sort;
    }else{
      location.href = href;
    }
    
});


mui('body').on('tap',".img",function(){
    href = $(this).attr("data-href");
    document.location.href=href;
});
mui('body').on('tap',".pic-box",function(){
    href = $(this).attr("data-href");
    document.location.href=href;
});

mui('body').on('tap',".line-list",function(){
    href = $(this).attr("data-href");
    document.location.href=href;
});






mui.init();
mui('body').on('shown', '.mui-popover', function(e) {});
mui('body').on('hidden', '.mui-popover', function(e) {});   

mui('.mui-scroll-wrapper').scroll({
    deceleration : 0.0005
});

mui('body').on('tap','a',function(){document.location.href=this.href;});



wx.config({
    debug: false,
    appId: '<?php echo $signPackage["appId"];?>',
    timestamp: '<?php echo $signPackage["timestamp"];?>',
    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
    signature: '<?php echo $signPackage["signature"];?>',
    jsApiList: [
      // 所有要调用的 API 都要加到这个列表中
      'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'onMenuShareQZone',
        'hideMenuItems',
        'showMenuItems',
        'hideAllNonBaseMenuItem',
        'showAllNonBaseMenuItem',

    ]
});


wx.ready(function(){
  var title = '邮轮旅游平台-航线列表';
  var desc = '邮轮旅游平台-航线列表';
  var link = '<?=sprintf("%s/front/default/index",yii::$app->request->getHostInfo())?>';
  var imgUrl = '<?=\Yii::$app->params['qiniu_path'].'/uploads/201706/1594cb321be769.jpg?imageView2/1/w/640/h/420';?>';
  
  wx.onMenuShareTimeline({
    title:desc,
    desc:desc,
    link:link,
    imgUrl:imgUrl,
    
  });
  wx.onMenuShareQQ({
    title:title,
    desc:desc,
    link:link,
    imgUrl:imgUrl,
    
  });
  wx.onMenuShareWeibo({
    title:title,
    desc:desc,
    link:link,
    imgUrl:imgUrl, 
  });
  wx.onMenuShareAppMessage({
    title:title,
    desc:desc,
    link:link,
    imgUrl:imgUrl,
  });
  wx.onMenuShareQZone({
    title:title,
    desc:desc,
    link:link,
    imgUrl:imgUrl,
    
  });
      
  
});


</script>
<?php app\components\JsBlock::end() ?>
